<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="huoyun" uri="/huoyun" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>运策网 首页</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/theme/css/main.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/theme/css/index.css">
<link rel="stylesheet" type="text/css"
			href="${pageContext.request.contextPath}/theme/css/jquery.ui.custom.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/theme/css/dialog.css">
	<script type="text/javascript" src="${pageContext.request.contextPath}/theme/js/calendar/WdatePicker.js"></script>
	
<script type="text/javascript"
	src="${pageContext.request.contextPath}/theme/js/jquery-1.6.js"></script>
<script type="text/javascript"
			src="${pageContext.request.contextPath}/theme/js/jquery.ui.custom.js"></script>
			<script type="text/javascript"
			src="${pageContext.request.contextPath}/theme/js/jquery.areaselect.js"></script>
			<script type="text/javascript"
			src="${pageContext.request.contextPath}/theme/js/areaData.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/theme/js/dialog.js"></script>
	<script type="text/javascript">
			function loadCargos(province,city){
			$.ajax({
				type : "post",
				url : "${pageContext.request.contextPath}/channel/cargoListIndex.action",
				data : {
					cargoProvince : province,
					cargoCity : city
				},
				dataType : "html",
				success : function(data) {
				
					var tmp;
					if(province==null || province==''){
						tmp=city;
					}else{
						tmp=province;
					}
					
					$("div#city-tab  .cur").removeClass("cur");
					$('#city_'+tmp).addClass("cur");
					$("#tab-pannel").html(data);
					
				}
			});
		}
		
		function loadCars(province,city){
			$.ajax({
				type : "post",
				url : "${pageContext.request.contextPath}/channel/carListIndex.action",
				data : {
					carProvince : province,
					carCity : city
				},
				dataType : "html",
				success : function(data) {
					var tmp;
					if(province==null || province==''){
						tmp=city;
					}else{
						tmp=province;
					}
					
					$("div#car-city-tab  .cur").removeClass("cur");
					$('#car_city_'+tmp).addClass("cur");
					$("#car-tab-pannel").html(data);
					
				}
			});
		}
	</script>
	<script type="text/javascript">
	$(function(){
		$("#source-area-select").areaselect({
			"source": EXPRESS.areaData,
			"showIn": "#source-area",
			"grade":3,
			"type":"source",
			after: function(target){
				curIndex = target.find('li.s-tab-t.current').attr('tabIndex');
				if(curIndex == 3) {
					target.areaselect("close");
				}
			}
		}).hide();
		$("#source-area").bind({"focus" : function(){
					if ($(this).val() === "请输入城市名") {
						$(this).val('');
					}
					this.select();
					
					$("#source-area-select").areaselect("open")
					.css({
						"top": $(this).position().top + 28,
						"left": $(this).position().left
					});

					if ($("#dest-area-select").areaselect) {
						$("#dest-area-select").areaselect("close");
					}
				},
				"blur": function(){
					if ($(this).val() === '') {
						$(this).val("请输入城市名");
					}				
				}			
			});
		$("#dest-area-select").areaselect({
			"source": EXPRESS.areaData,
			"showIn": "#dest-area",
			"grade":3,
			"type":"source",
			after: function(target){
				curIndex = target.find('li.s-tab-t.current').attr('tabIndex');
				if(curIndex == 3) {
					target.areaselect("close");
				}
			}
		}).hide();
		$("#dest-area").bind({"focus" : function(){
					if ($(this).val() === "请输入城市名") {
						$(this).val('');
					}
					this.select();
					
					$("#dest-area-select").areaselect("open")
					.css({
						"top": $(this).position().top + 28,
						"left": $(this).position().left
					});

					if ($("#source-area-select").areaselect) {
						$("#source-area-select").areaselect("close");
					}
				},
				"blur": function(){
					if ($(this).val() === '') {
						$(this).val("请输入城市名");
					}				
				}			
			});
		$('html').bind("click", function(event){
				var target = $(event.target);
				var	isArea = (target.attr("id") == "source-area" || target.attr("id") == "dest-area");

				if (!isArea)
				{
					$("div.area-select").areaselect("close");
				}
			});			
			
	
		$("#topMenu_mycyw").bind({"focus" : function(){
				$(this).find(".more_con").show();
			},
			"blur": function(){
				$(this).find(".more_con").hide();			
			}			
		});
	})
	</script>
  </head>

	<body>
		<jsp:include page="/header.jsp"></jsp:include>
		
		<div class="home">
			<div class="w990 home-content clearfix">
				<div class="left-box">
					<div class="search-goods">
					<span>
					<input value="请输入城市名" class="area-text area-t ui-autocomplete-input" autocomplete="off" id="source-area">
					<input value="请输入城市名" class="area-text area-t ui-autocomplete-input" autocomplete="off" id="dest-area">
					<div id="source-area-select" class="area-select area-tab"></div>
					<div id="dest-area-select" class="area-select area-tab"></div>
					</span>
					<span class="button button-mblue">
						<input type="submit" value="搜货" class="button-text">
					</span>
					</div>
				</div>
				<div class="right-box">
					<div class="add-goods">
						<div class="button button-lorange">
							<input type="submit" value="发布货源" class="button-text">
						</div>
					</div>
				</div>
			</div>
			<div class="w990 home-content clearfix">
				<div class="fl mt10 w190">
				 <div>交易统计：昨天</div>
				 <div>交易数量：<s:property value="orderCountYesterday"/>个</div>
				 <div>交易金额：<s:property value="orderPriceSumYesterday"/>元</div>
				 <div>新增货源：<s:property value="newCargoCount"/>件</div>
				 <div>新增车源：<s:property value="newCarCount"/>辆</div>
				</div>
				<div class="fr mt10 w800">
					<s:include value="/adv.jsp"></s:include>
				</div>
			</div>
			<div class="w990 home-content clearfix">
				<div class="fl new-box">
					<div class="hd" >
						<h2><a href="" >最新货源</a></h2>
						<div class="city-tab" id="city-tab" >
							<ul class="tab-nav">
							 <li href="#new_goods_infos" class="cur" id="city_1"><a href="javasrcipt:void(0);onclick=loadCargos('1','')" >北京</a></li>
							 <li href="#new_goods_infos" id="city_786"><a href="javascript:void(0);onclick=loadCargos('786','')" >上海</a></li>
							 <li href="#new_goods_infos" id="city_1907"><a href="javascript:void(0);onclick=loadCargos('','1907')" >广州</a></li>
							 <li href="#new_goods_infos" id="city_1920"><a href="javascript:void(0);onclick=loadCargos('','1920')">深圳</a></li>
							 <li href="#new_goods_infos" id="city_928"><a href="javascript:void(0);onclick=loadCargos('','928')" >杭州</a></li>
							 <li href="#new_goods_infos" id="city_2233"><a href="javascript:void(0);onclick=loadCargos('','2233')">成都</a></li>
							</ul>
						</div>
	                    <span class="more"><a href="#" target="_blank">更多</a></span>
					</div>
					<div class="bd clearfix tab-content" id="new_goods_infos">
						<div class="tab-pannel" id="tab-pannel">
							
						<jsp:include page="ajaxCargoList.jsp"></jsp:include>
							
							
						</div>
					</div>
				</div>
				
				<div class="fr new-box">
					<div class="hd" >
						<h2><a href="" >最新车源</a></h2>
						<div class="city-tab" id="car-city-tab" >
							<ul class="tab-nav">
						 <li href="#new_goods_infos" class="cur" id="car_city_1"><a href="javascript:void(0);onclick=loadCars('1','');">北京</a></li>
							 <li href="#new_cars_infos" id="car_city_786"><a href="javascript:void(0);onclick=loadCars('786',''); ">上海</a></li>
							 <li href="#new_cars_infos" id="car_city_1907"><a href="javascript:void(0);onclick=loadCars('','1907')">广州</a></li>
							 <li href="#new_cars_infos" id="car_city_1920"><a href="javascript:void(0);onclick=loadCars('','1920')">深圳</a></li>
							 <li href="#new_cars_infos" id="car_city_928"><a href="javascript:void(0);onclick=loadCars('','928')">杭州</a></li>
							 <li href="#new_cars_infos" id="car_city_2233"><a href="javascript:void(0);onclick=loadCars('','2233')">成都</a></li>
							</ul>
						</div>
	                    <span class="more"><a href="#" target="_blank">更多</a></span>
					</div>
					<div class="bd clearfix tab-content" id="new_car_infos">
						<div class="tab-pannel" id="car-tab-pannel">
							<jsp:include page="ajaxCarList.jsp"></jsp:include>
							<!--<ul class="round-box clearfix">
							
								<li><span class="rounte">[日用品]西安 到 南京</span> <span class="amount">20吨</span> <span>2012-12-11 12:34:43</span></li>
								<li><span class="rounte">[日用品]西安 到 南京</span> <span class="amount">20吨</span> <span>2012-12-11 12:34:43</span></li>
								<li><span class="rounte">[日用品]西安 到 南京</span> <span class="amount">20吨</span> <span>2012-12-11 12:34:43</span></li>
								<li><span class="rounte">[日用品]西安 到 南京</span> <span class="amount">20吨</span> <span>2012-12-11 12:34:43</span></li>
								<li><span class="rounte">[日用品]西安 到 南京</span> <span class="amount">20吨</span> <span>2012-12-11 12:34:43</span></li>
								<li><span class="rounte">[日用品]西安 到 南京</span> <span class="amount">20吨</span> <span>2012-12-11 12:34:43</span></li>
								<li><span class="rounte">[日用品]西安 到 南京</span> <span class="amount">20吨</span> <span>2012-12-11 12:34:43</span></li>
								<li><span class="rounte">[日用品]西安 到 南京</span> <span class="amount">20吨</span> <span>2012-12-11 12:34:43</span></li>
							</ul>-->
						</div>
					</div>
				</div>
			</div>
		
		<div class="w990 home-content clearfix">
		<div class="new-box" style="width: 990px;">
					<div class="hd" >
						<h2><a href="" >10000个交易正在进行...</a></h2>
	                    <span class="more"><a href="#" target="_blank">更多</a></span>
					</div>
					<div class="bd clearfix tab-content" id="new_goods_infos">
						<div class="tab-pannel">
							<ul class="round-box clearfix">
								<s:iterator var="orderObj" value="orderPage.objectList">
								<li>							
									<span class="rounte">&nbsp;<s:property value="#orderObj.cargosTitle"/>&nbsp;<huoyun:regionSelect provinceValue="${orderObj.startProvince}" cityValue="${orderObj.startCity}" type="view"/>到<huoyun:regionSelect provinceValue="${orderObj.destinationProvince}" cityValue="${orderObj.destinationCity}" type="view"/></span>
									<span class="amount"><s:property value="#orderObj.cargoAmount"/>吨</span>
									<span>选择了<s:property value="#orderObj.carNumber"/></span>
									<span class="amount"><s:property value="#orderObj.price"/>元</span>
									<span><huoyun:dateFormat date="${orderObj.addTime}" dateFormat="yyyy-MM-dd"/></span>
								</li>	
								</s:iterator>
							
								<!--<li><span class="rounte">[日用品]西安 到 南京</span> <span class="amount">20吨</span><span>选择了 <a>陕A1234</a>和<a>陕A3456</a></span> <span class="amount">100000元</span> <span>2012-12-11 12:34:43</span></li>-->
								
							</ul>
						</div>
					</div>
				</div>
		</div>
		
		<div>
			<jsp:include page="/footer.jsp"></jsp:include>
		</div>

	</body>
</html>
